package chapter1.listSet.task.company1;

import java.util.Objects;

public class Staff implements Comparable<Staff> {
    private String sNo; 
    private String name;
    private int age;
    private String sex;
    private String status;  
    private int salary; 

    @Override
    public boolean equals(Object obj) {
        Staff staff = (Staff) obj;
        return Objects.equals(sNo, staff.sNo);   
    }

    @Override
    public int compareTo(Staff o) { 
        return salary - o.salary;
    }

    @Override
    public String toString() {
        return "工号:" + sNo + ",员工姓名:" + name + ",年龄:" + age + ",性别:" + sex + ",职务:" + status + ",薪水:" + salary + "元";
    }

    public String getsNo() {
        return sNo;
    }

    public void setsNo(String sNo) {
        this.sNo = sNo;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public int getSalary() {
        return salary;
    }

    public void setSalary(int salary) {
        this.salary = salary;
    }
}
